We formulate and study a generalized virial theorem for contact Hamiltonian systems. Such systems describe mechanical systems in the presence of simple dissipative forces such as Rayleigh friction, or the vertical motion of a particle falling in a fluid (quadratic drag) under the action of constant gravity. We find a generalized virial theorem for contact Hamiltonian systems which is distinct from that obtained earlier for the symplectic case. The `contact' generalized virial theorem is shown to reduce to the earlier result on symplectic manifolds as a special case. Various examples of dissipative mechanical systems are discussed. We also formulate a generalized virial theorem in the contact Lagrangian framework.