Nuclear deformation energy curves with the constrained Hartree-Fock method