One uses the countability of the rationals in order to be able to construct the family $(U_p)$ of open sets with the property $$p < q \Rightarrow \overline{U}_p \subset U_q\tag{1}.$$ At each step, only finitely many rationals have been treated before, so when constructing (well, kind of) $U_p$, where $p$ is the $k$-th rational in the enumeration, there are well defined $q = r_i$ and $s = r_j$ with $i,j < k$ such that $q < p < s$ and for every $m < k$ we have either $r_m \leqslant q$ or $r_m \geqslant s$. That gives us an exact place where to fit $U_p$. Then by induction, there is a family $\{ U_p : p \in [0,1]\cap\mathbb{Q}\}$ such that $(1)$ holds for all $p,q\in [0,1]\cap\mathbb{Q}$.
After that, the denseness of the rationals is used to extend the family to all reals in $[0,1]$ keeping property $(1)$, or, in the other variant of the proof I know, directly construct the Urysohn function without extending the family of open sets (that's only a cosmetic difference, of course).
The countability is required to be able to construct the family of open sets, and the denseness of the rationals (or the dyadic rationals) is needed to ensure the continuity of the constructed function.