Periodic solutions of Hamiltonian systems with a subquadratic potential