Formula is (a^2+b^2)/ab+1

Let a and b be positive integers such that (ab+1) divides (a^2+b^2). Show that (a^2+b^2)/(ab+1) is the square of an integer.