Periodic and subharmonic solutions for a class of superquadratic Hamiltonian systems