  A set $V$ in a domain $U$ in $\mathbb{C}^n$ has the {\em norm-preserving
extension property} if every bounded holomorphic function on $V$ has a
holomorphic extension to $U$ with the same supremum norm. We prove that an
algebraic subset of the {\em symmetrized bidisc} \[ G := \{(z+w,zw):|z|<1, |w|
< 1 \} \] has the norm-preserving extension property if and only if it is
either a singleton, $G$ itself, a complex geodesic of $G$, or the union of the
set $\{(2z,z^2): |z|<1\}$ and a complex geodesic of degree $1$ in $G$. We also
prove that the complex geodesics in $G$ coincide with the nontrivial
holomorphic retracts in $G$. Thus, in contrast to the case of the ball or the
bidisc, there are sets in $G$ which have the norm-preserving extension property
but are not holomorphic retracts of $G$. In the course of the proof we obtain a
detailed classification of the complex geodesics in $G$ modulo automorphisms of
$G$. We give applications to von Neumann-type inequalities for
$\Gamma$-contractions (that is, commuting pairs of operators for which the
closure of $G$ is a spectral set) and for symmetric functions of commuting
pairs of contractive operators. We find three other domains that contain sets
with the norm-preserving extension property which are not retracts: they are
the spectral ball of $2\times 2$ matrices, the tetrablock and the pentablock.
We also identify the subsets of the bidisc which have the norm-preserving
extension property for symmetric functions.
