I just use a peice of paper, news paper or foolscap works just fine. Just tear a peice off and place it between the socket and nut. Then push the nut into the socket.
Another good tip is for u-joint sockets on the end of an extension. Most of the time the u-joint is too loose and just flops down with the weight of the nut. If you wrap electrical tape around the u-joint, it won't flex so easily and you'll be able to get the nut to the desired stud easier.