In general, the role of the iris is to regulate the amount of light entering the eye by making the pupil expand and contract. The iris is a sphincter muscle.
In bright sunlight (or bright artificial light, for that matter) the iris muscle pulls towards its center. By doing so, it reduces the size of the pupil and lets less light through.
So, yes, the muscle in the iris does contract when exposed to light and dilate when the amount of light is reduced. It does so in order to increase or reduce the amount of light that enters the eye.
The iris is part of the human eye that can be seen through the cornea. It has three layers; endothelium, stroma, and the epithelium.
It is divided into two separate chambers; the anterior chamber which is located between the cornea and the iris, and the posterior which is located between the iris and the lens.
The iris resembles a camera shutter. When too much light enters the eye, the sphincter muscle draws the pupil inward. When the light is reduced the iris muscle that is wheel like twists and pulls outward creating a larger opening for the pupil.