Device for varying the intensity of light