Hello Hepatitis B vaccine is made of only proteins & not the entire virus, so it is safe during preganacy. You should ask your doctor about it again. Take WHO recommedations with you. I again state Hep B vaccine ie perfectly safe during pregnancy.
You also have to understand it is ony 90% effective when given before age 40yrs. That means only 90 people out of 100 will develope immunity.
Talk to your doctor in detail about it. Regards Rahul