Viscoplasticity: A thermodynamic formulation