Theory of energy dissipation in a viscoelastic body under time-dependent stress