The way I would do it is by using that on $|z| = 1$, $\bar{z} = \frac{1}{z}$, so you can rewrite the fraction $\frac{|z-a|^2}{|z-b|^2}$ as $\frac{(z-a)(1-z\bar{a})}{(z-b)(1-z\bar{b})}$ which is analytic, and then use the residue theorem while considering a few special cases like $a=b$, $a=0$, $b=0$, $b\bar{a} = 1$ separately, since outside of such, there are just two distinct simple poles inside the unit disc, namely $0$ and $b$.