Photocontrolled nanophase segregation in a liquid-crystal solvent