Minimization of conformally invariant energies in homotopy classes