The effect of illumination on the formation of metal halide perovskite films