A variational problem for submanifolds in a sphere