The Dirichlet energy of mappings with values into the sphere