Let $(a_n)$ be a sequence in $A$ that converges to a point $x\in X$. Since $A$ is a retract subspace, there is a continuous map $r:X\to A$ such that $r(a)=a$ for every $a\in A$. By continuity, we have $a_n=r(a_n)\to r(x)$. By uniqueness of limits in a metric space, we have $x=r(x)\in A$. Therefore $A$ is closed.
By replacing sequences by nets, this can be generalized to any Hausdorff space $X$.