Quantum control of two-photon photochromism in the solid phase