  We propose a practical approximation to the exchange-correlation functional
of (time-dependent) density functional theory for many-electron systems coupled
to photons. The (time non-local) optimized effective potential (OEP) equation
for the electron- photon system is derived. We test the new approximation in
the Rabi model from weak to strong coupling regimes. It is shown that the OEP
(i) improves the classical description, (ii) reproduces the quantitative
behavior of the exact ground-state properties and (iii) accurately captures the
dynamics entering the ultra-strong coupling regime. The present formalism opens
the path to a first-principles description of correlated electron-photon
systems, bridging the gap between electronic structure methods and quantum
optics for real material applications.
