In this paper we prove the existence and uniqueness of the weak solution for a dynamic thermoviscoelastic problem describing contact problem between the body and foundation. The process is dynamic, the material behaviour is described by nonlinear viscoelastic law, strongly coupled with the thermal effects. The contact is modelled by nonmonotone subdifferential boundary conditions. The mechanical damage of the material is described by a parabolic equation. We use recent results from the theory of hemivariational inequailities and fixed point theorems.