Centers and limit cycles of vector fields defined on invariant spheres