The generalized Fermat equation over totally real number fields