The definition of a contractible space. I wonder if my approach is completely wrong. If so, may I request for some hints for heading to the right direction? Thank you!

Show that a retract of a contractible space is contractible.


The previous discussion Proof that retract of contractible space is contractible. used the definition that

The identity map on X is null-homotopic, i.e. if it is homotopic to some constant map.


But as to what I found, a space being contractible is simply defined as

A space having the homotopy type of a point is called contractible. 

So following this definition, I can only carried out the proof in such a way:
We retract this space $X$ to $A \subset X$. Since $A$ is a subset of $X$, $A$ is also contractible.
So I am wondering, did I miss the definition somewhere? Or I should just use the other definition?
Thank you...

A hint:
You have maps $A \xrightarrow{i} X \xrightarrow{r} A$ such that $ri = id_A$. You are also given the existence of a map $H : X \times I \to X$ such that, for each $x$, $H(x,0) = x$ and $H(x,1) = *$ for some fixed point $* \in X$. You can show that you might as well choose $* \in A$ (think about why -- must $X$ be path connected?) 
You need to show the existence of a map $\widetilde{H} : A \times I \to A$ such that $\widetilde{H}(a,0) = a$ and $\widetilde{H}(a,1) = *$ for every $a \in A$. Try to build $\widetilde{H}$ using  the maps $H,i$ and $r$.
