Scale a UV mapping to fit a exact rectangle
You may select the desired vertex of the uv island, press G, then X (or Y depending on what axis you want it to transform) and type the value using keyboard. You can also enable the Snap during transform (Increment) option to snap the vertex to the grid in the Uv Editor (hold Shift to snap by smaller distances).


You can also use the vertex coordinates buttons in the UV Vertex panel of the UV Editor's properties shelf (N).


You can edit your UV island's appearance using the same tools as in 3d view window. To make the edge perfectly horizontal or vertical select the vertex you want the other ones to allign to and press Shift+S-->Cursor to Selected. Next (with the pivot type set to 2D Cursor) select the vertices to allign and scale it by 0 along X or Y axes (S,X (or Y),0).