Periodic solutions for a class of second order Hamiltonian systems