A mathematical analysis of a dynamical frictional contact model in thermoviscoelasticity