Area theorem and energy quantization for dissipative optical solitons