# Smooth retraction onto a differentiable manifold

Let $M\subset\mathbb{R}^n$ be a smooth k-dimensional differentiable manifold (by which I mean that it is locally diffeomorphic to an open set in $\mathbb{R}^k$). Let us suppose $M$ compact for simplicity.
How can one prove that there exists an open set $U\supset M$ and a smooth retraction of $U$ onto $M$? I heard that it has to do with the smooth dependence on initial conditions of the solution of an ODE.. Can somebody shed light on this?
(Remark: clearly $U$ can't be arbitrary, since for example $\mathbb{R}^2$ does not retract onto $S^1$)

-