Modeling via the internal energy balance and analysis of adhesive contact with friction in thermoviscoelasticity