Quantum master equation and deformation theory