Try following the instructions here: http://www.holoborodko.com/pavel/2011/02/01/how-to-compile-qt-4-7-with-visual-studio-2010/
The only difference being that I've changed "msvc2010" to "msvc2012" when it occurs. Also make sure you are running "configure.exe" inside the context of the visual studio command line (Start > All Programs > Microsoft Visual Studio 2012 > Visual Studio Tools )
PS: Jom is unnecessary, but useful since it will allow you to use more than one core.
EDIT: I tried to follow my own instructions here (was waiting for it to build) and I'm also failing on the same spot with the same return value.
This is where it starts getting errors:
....\corelib\io\qfsfileengine_win.cpp(1012) : error C2065: 'PATH_MAX'
: undeclared identifier
...then this happens
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual
Studio 12.0 \VC\BIN\cl.EXE"' : return code '0x2' Stop. NMAKE : fatal
error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0
\VC\BIN\nmake.exe"' : return code '0x2' Stop. NMAKE : fatal error
U1077: 'cd' : return code '0x2' Stop.
Darn. I'll keep trying - will edit answer if I find out what's going on.
This answer might help? Compiling Qt 4.8.x for Visual Studio 2012