Exact solution of the equations of molecular optics for refraction and reflection of an electromagnetic wave on a semi-infinite dielectric