Extending commutative multiplications and André-Quillen cohomology