We've all been there. Most of us that attend(ed) law school are OCD anyway, so it just makes things worse.
Have a rational discussion with yourself:
A. Of course
, missed issues popped in your head in the middle of the night. That's because you're relaxed and no longer under exam pressure. It happened to you and it happened to everyone else in that room. But that's all part of the game. Your grader is well aware that your answer was written under time constraints. Nobody's answer will be perfect. Oftentimes we tend to dwell on the stuff we forgot to write and we totally dismiss the fact that we were really strong on another question or another issue. Most of the time your grade will be significantly higher than you anticipated. Because (a) you did have some good stuff in there and (b) everyone else missed issues too.
B. Dont' beat yourself up. It's wasted energy and you don't want to carry that into your next exam. Most law students were top of their class throughout their entire academic career. They're used to success. Getting comfortable with the ocassional failure is part of the "process." It also helps steel you for the courtroom. Things don't always go your way but you don't quit. You just dust yourself off, get back on your horse, and fight on.
C. Take a big picture approach. It's just one exam out of many, many that you'll take over the course of your law school tenure. You'll have good and you'll have bad. Eventually it'll balance out. And guess what? One day, and it'll come much faster than you can imagine, you'll be graduating and those blown issues in Contracts will seem like a very distant memory. They'll no longer matter.
So sit back and enjoy. The whole experience goes quickly and you'll realize at the end that the failure was as much a part of the learning process as the success. Good luck.