A mechanical Kerr effect in deformable photonic media