Let me focus on how to deduce a bound for all coefficients $a_n$ assuming the Deligne bound on $a_p$ (this is a standard argument).
Let $f$ be a newform of weight $k$, level $N$ and Nebentypus character $\psi$ modulo $N$. Assume the Deligne bound $|a_p| \leq 2p^{(k-1)/2}$, and let us prove the inequality $|a_n| \leq d(n) n^{(k-1)/2}$ for every $n \geq 1$ (here $d(n)$ is the number of positive divisors of $n$).
Since both sides are multiplicative in $n$, it suffices to consider the case $n=p^m$, where $p$ is prime. Put $u_m=a_{p^m}$. By looking at the Euler factor of $f$ at $p$, we know the following formal identity :
$\sum_{m \geq 0} u_m X^m = \frac{1}{1-a_p X +\psi(p) p^{k-1} X^2}$.
Now there are two main cases :
$p$ divides $N$. Then $\psi(p)=0$ and $u_m = a_p^m$ for every $m \geq 0$. It can be shown, using purely analytical arguments, that $|a_p| \leq p^{(k-1)/2}$ (see Theorem 3 in Li's article "Newforms and functional equations", Math. Ann., 1975). Thus we get $|u_m| \leq p^{m(k-1)/2}$ which gives the desired inequality (and in fact, a stronger one).
$p$ doesn't divide $N$. Put $1-a_p X +\psi(p) p^{k-1} X^2 = (1-\alpha X)(1-\beta X)$. In the case $k \geq 2$, the Weil conjectures proved by Deligne imply that $|\alpha|=|\beta|=p^{(k-1)/2}$ (this still holds if $k=1$, by a theorem of Deligne and Serre). There are two subcases :
2a) $\alpha \neq \beta$. Solving the linear recurrence relation satisfied by $u_m$ gives
$u_m = \frac{\alpha^{m+1}-\beta^{m+1}}{\alpha-\beta} = \alpha^m+\alpha^{m-1} \beta + \ldots + \beta^m$.
In particular $|u_m| \leq (m+1) p^{m(k-1)/2}$ which is what we want.
2b) $\alpha = \beta = \frac{a_p}{2}$. In this case $u_m = (m+1) \alpha^m$ for every $m \geq 0$, and the inequality also follows.
Remarks : It is conjectured that case 2b never happens if $k \geq 2$ (semi-simplicity of crystalline Frobenius). Note also that in case 2a, we can write $u_m = \beta^m (1+\lambda+ \ldots + \lambda^m)$, where $\lambda := \alpha/\beta$ satisfies $|\lambda|=1$ and $\lambda \neq 1$. Thus in fact we get a bound of the form $|u_m| \leq C \cdot p^{m(k-1)/2}$, where the constant $C$ depends only on the argument of $\alpha/\beta$. Finally, note that we also have the strict bound $|a_p|<2p^{(k-1)/2}$ in case 2a.
EDIT : case 2b can indeed happen in the case $k=1$ (thanks to David for pointing this out).