Text this: Nonsmooth dynamics of contacting thermoelastic bodies