Hit Ctrl + Alt + F1 to reach the first virtual console. Log in there, then follow the instructions.
To get all the relevant stuff, including the kernel sources and kernel headers run next command
sudo apt-get install build-essential linux-source linux-headers
If the package
linux-headers is not available, try running the command by specifying the exact version of the headers with:
sudo apt-get install linux-headers-`uname -r`
Next, install the current Nvidia driver:
sudo apt-get install nvidia-current
Once the installation completes successfully, check if the Nvidia driver is loaded:
sudo /sbin/lsmod | grep nvidia
If it's not, you will need to manually insert into memory. First, make sure all kernel module dependencies are satisfied and resolved:
sudo depmod -a
Then, load the driver:
sudo modprobe nvidia_current
This should succeed and the
lsmod command should show it's loaded, but the usage count will probably be 0, because nothing will be using it yet. You will need to restart the graphics environment to actually benefit from the driver:
sudo /etc/init.d/lightdm restart
This will restart the graphics environment, you will see the Nvidia splash, and you will load into a desktop that has the Nvidia driver running, and all that. Your problem is now resolved.
Source: http://www.dedoimedo.com/computers/ubuntu-quetzal-nvidia.html (even if the specified source is related to Ubuntu 12.10, I test this method and is working perfectly on Ubuntu 13.04).