Reflection and refraction of light from metasurfaces with phase discontinuities