Your objective function is already convex. This follows because the Hessian matrix $$\frac2{y^3}\,\begin{bmatrix} y^2&-xy\\-xy&x^2 \end{bmatrix}$$ of the map $\mathbb R\times(0,\infty)\ni(x,y)\to y\Big(\dfrac xy-r\Big)^2$ is positive semidefinite, for any given real $r$.