This is an exercise in Hatcher's Algebraic Topology. There is a solution in this link: Fundamental Group of surface with infinite genus is free on infinite generators, which uses the van Kampen theorem.
However the question says that compute the fundamental group of the surface by showing that it deformation retracts onto a graph, so I want to use this approach. But I can't see how does this surface deformation retracts onto a graph. What graph should the surface deformation retracts onto?

There are some choices, but Frederik is right. One graph is a line connecting an infinite number of circles. Draw a circle about each hole and then connect them with lines running from each circle to the next. Ascii art: $$\cdots\text{ -o-o-o-o-o- }\cdots$$ The surface can be deformed to this graph. First squeeze between each hole to a tube about the line. Each hole squeezes to a torus about the circle. So you have a sequence of toruses connected by tubes. Continue to shrink the tube diameters and torus minor diameter to $0$, and you end up with the infinite connected circles graph. A little further deformation gets you the circles linked to the line as described by Frederik. For example, the union of the $x$-axis and circles of radius $\frac 13$ centered around $\left(n, \frac13\right)$ for each $n \in \Bbb Z$.