Mosquitoes are attracted to UV lights. This is because they use light to navigate in the dark and hunt their prey. They confuse artificial lights for the light of the stars and moon, which they would normally use.
Mosquitoes do not have good eyesight, so they need light to help them hunt. Mosquitoes are not attracted to every light. Yellow lights and red lights actually repel mosquitoes as they find it unpleasant. The reason mosquitoes circle around lights is because they catch the light in one of their eyes, which causes the wing on that side to flutter a little weaker and makes them circle around.