In dry conditions, headlight illumination bounces off of the reflective paint back to the driver's eyes. However, water acts like a lens which disperses the lights, so that that much of it is reflected in different directions. As a result, the lines become almost invisible to the driver. The same effect makes the road appear darker. A normal road has a rough surface, which causes some of the head light beam to reflect back to the driver's eye.
Rainwater fills in the rough irregularities and creates a smooth mirror-like finish on the road.
The headlight beams then strike the road and instead of reflecting back, reflects forward. The road appears darker and therefore it becomes harder to see pedestrians who are wearing dark clothes - their contrast is lower. The mirror-finish of the road also causes light from any other source, streetlamps, business signs or headlights of other cars, to be more likely to shine in the driver's eyes and cause glare. Lastly, water reduces the reflectivity of most materials. Less illumination falling on the object is reflected back, so the objects appear darker and have lower contrast.