Deformation of a pretilted nematic liquid crystal layer in an electric field