3D physics and the electroweak phase transition: Perturbation theory