You can do this without integration, by performing the following steps.
Calculate the coordinates of the vertices of your rectangle. Let the vertices be $v_1,v_2,v_3,v_4$.
Let your point "source" be $O$. Normalize the vectors $Ov_j$ by dividing each vector on its length. This gives you 4 points on the unit sphere centered at $O$.
Connect those 4 points by great circles in the correct order. You obtain a spherical quadrilateral. Find its interior angles, by spherical trigonometrybreaking the quadrilateral into two triangles and applying the spherical rule of cosines. (They are the same as dihedral angles of the cone built on $Ov_j$. Cosines of the sides and diagonals are simply the dot products of corresponding normalized vectors.)
Your solid angle is the area of this spherical quadrilateral, and once you know the interior angles it is equal to the sum of these angles minus $2\pi$.