A spinorial characterization of hyperspheres