The human eye in its resting/relaxed state is focused on far away images. The muscles in your eye contract to focus on images closer up. When your eyes are closed, there isn't light coming into the retina so there is no need to focus any image. The eye stays in it's relaxed form throughout sleeping. You can sense this by closing your eyes for a while and opening them. You will notice they are relaxed and in focus for distant objects, but they have to contract to focus on nearby objects.