Equivariant Morse theory and closed geodesics