Fasting is only required if you feel healthy, so if you are concerned it could affect the health of your baby, you should be excused. Pregnant women whose weight and lifestyle are generally healthy seem to cope better with fasting. You may be able to fast and still get enough calories, but it is hard to go for long stretches without food or fluid.
Most miscarriages happen in the first three months of pregnancy, and it's estimated that often women miscarry before they even realise that they are pregnant.