  Since July 2014, the Gaia space mission has been continuously scanning the
sky and observing the extragalactic Universe with unprecedented spatial
resolution in the optical domain ($\sim$ 180 mas by the end of the mission).
Gaia provides an opportunity to study the morphology of the galaxies of the
local Universe (z<0.45) with much higher resolution than has ever been attained
from the ground. It also allows us to provide the first morphological all-sky
space catalogue of nearby galaxies and galaxies that host quasars in the
visible spectrum. We present the Data Processing and Analysis Consortium
CU4-Surface Brightness Profile fitting pipeline, which aims to recover the
light profile of nearby galaxies and galaxies hosting quasars. The pipeline
uses a direct model based on the Radon transform to measure the two-dimensional
surface brightness profile of the extended sources. It simulates a large set of
2D light profiles and iteratively looks for the one that best reproduces the 1D
observations by means of a Bayesian exploration of the parameters space. We
also present our method for setting up the input lists of galaxies and quasars
to be processed. We successfully analysed 1\,103\,691 known quasars and
detected a host galaxy around 64\,498 of them ($\sim$6\%). We publish the
surface brightness profiles of the host for a subset of 15\,867 quasars with
robust solutions. The distribution of the S\'ersic index describing the light
profile of the host galaxies peaks at $\sim$ 0.8 with a mean value of $\sim$
1.9, indicating that these galaxies hosting a quasar are consistent with
disc-like galaxies. The pipeline also analysed 940\,887 galaxies with both a
\sersic and a de Vaucouleurs profile and derived robust solutions for 914\,837
of them. The distribution of the S\'ersic indices confirms that \gaia mostly
detects elliptical galaxies and that very few discs are measured.
