Optical absorption and dielectric loss due to resonance in liquids