Many women have nosebleeds for the first time while pregnant. They are usually harmless. You have more blood vessels inside your nose while pregnant and nosebleeds are caused by a tear in one of those blood vessels.
The best way to stop the bleed is to sit up with your face pointing downwards and pinch the soft lower part of your nose for 10 minutes.
If this does not work, then you can put a some ice in a small plastic bag (using your other hand) and apply it over your nose and cheek. Try to avoid blowing your nose after the bleeding has stopped.
Contact your doctor if it has not stopped within 10 minutes. If the nosebleeds recur frequently, ask your health care provider to refer you to an Ear Nose and Throat (ENT) doctor.