A moving charge generates a magnetic field. The difference between the three p-orbitals is the vectoral orientation of the (orbital) angular momentum of the moving electron, which by convention is defined along the z-axis. If the external magnetic field is also in the z-direction, then an electron in one of the orbitals has a momentum vector aligned with the external field*, one aligned against the external field, and one aligned perpendicular to it. Thus the magnetic field induced by the moving electron in each of these orbitals is also aligned with, against, or perpendicular to the external field. The interaction of the induced and external field can be expressed as an energy... hence in an external field electrons in the three orbitals have different energies.
(*Actually, only a part is aligned with the field, but it's the same difference as far as a qualitative explanation is concerned.)