In this paper we consider a hyperbolic-parabolic problem that models the longitudinal deformations of a thermoviscoelastic rod supported unilaterally by an elastic obstacle. The existence and uniqueness of a strong solution is shown. A finite element approximation is proposed and its convergence is proved. Numerical experiments are reported.