Let $\mathcal{B}$ be a countable base for $X$.
We can assume that $\mathcal{B}$ is closed under finite unions (just add all finite unions, of which there are only countably many, using a standard closure argument).
For every $B \in \mathcal{B}$ define $V(B) = Y \setminus f[X \setminus B]$ which is open in $Y$ as $f$ is a closed map.
Then this is a base for $Y$:
suppose $O$ is open in $Y$ and $y \in O$. Then $f^{-1}[\{y\}] \subseteq O$ and so there are finitely many base members $B_1, \ldots, B_n$ such that $f^{-1}[\{y\}] \subseteq B_1 \cup \ldots B_n \subseteq O$ (this uses compactness of the fibres, we have such a $B_x$ for every $x \in f^{-1}[\{y\}]$, and then take a finite subcover). As our countable base is closed under finite unions, $B = \cup_{i=1}^n B_i \in \mathcal{B}$ and this obeys
$$f^{-1}[\{y\}] \subseteq B \subseteq f^{-1}[O]$$
But then $$ y \in V(B)$$
(suppose $y \notin V(B)$, then $y \in f[X \setminus B]$, so there is some $x \in X \setminus B$ with $f(x) = y$. But then $x \in f^{-1}[\{y\}]$ while $x \notin B$, contradicting $f^{-1}[\{y\}] \subseteq B$, so $y \in V(B)$) and also
$$f^{-1}[V(B)] \subseteq B$$
(suppose $x \in f^{-1}[V(B)]$, so $f(x) \in V(B)$ and suppose $x \notin B$, then $f(x) \in f[X \setminus B]$ and so $f(x) \notin V(B)$ contradiction, so $x \in B$ as required).
Surjectivity of $f$ then also gives $V(B) \subseteq O$: if $y' \in V(B)$ there is some $x' \in X$ with $f(x') = y'$. Then $x' \in f^{-1}[V(B)]$ so $x' \in B$ by the previous, and we already know that $B \subseteq f^{-1}[O]$, so $y' = f(x') \in O$ as required.
So $\{V(B): B \in \mathcal{B}\}$ is a countable open base for $Y$.