How can I protect my baby from the effects of hepatitis b in pregnancy?

Vaccinate. Ideally you should be vaccinated against hepatitis b before you ever become pregnant. If you happen to carry hepatitis b then your baby will get two vaccines upon birth to protect it from hepatitis b.
Preventable. If a pregnant woman is infected with hep b, then the risk of transmission to the fetus is high during peripartum period (vertical transmission). Mom can be treated with antivirals in the 3rd trimester (optional). The infant needs both immediate passive (hbig) and active immunization (hep b vaccination). Cdc recommendations: http://www.Immunize.Org/acip/hbvinfant_dearcolleague.Pdf.
Placenta as barrier. The placenta is a great barrier to the hepatitis b virus. It does not pass through the membranes unless there is a rupture, so infection of the baby is rare.