Existence and multiplicity of solutions for a second-order impulsive differential equation via variational methods