Let $A$ be a $C^*$-algebra and $\mathcal{E}\colon A \to A$ a conditional expectation. The Kadison-Schwarz inequality for completely positive maps, $$\mathcal{E}(x)^* \mathcal{E}(x) \leq \mathcal{E}(x^* x),$$implies that$$\left\Vert\mathcal{E}(x)\right\Vert^2 \leq \left\Vert\mathcal{E}(x^* x)\right\Vert.$$In this note we show that $\mathcal{E}$ is homomorphic (in the sense that $\mathcal{E}(xy) = \mathcal{E}(x)\mathcal{E}(y)$ for every $x, y$ in $A$) if and only if$$\left\Vert\mathcal{E}(x)\right\Vert^2 = \left\Vert\mathcal{E}(x^*x)\right\Vert,$$for every $x$ in $A$. We also prove that a homomorphic conditional expectation on a commutative $C^*$-algebra $C_0(X)$ is given by composition with a continuous retraction of $X$. One may therefore consider homomorphic conditional expectations as noncommutative retractions.