An energy principle for dissipative fluids