You have to check ahead of time how much of the grade is based on your in-class contributions to the discussion. I also don't particularly like to speak up in literature classes and the like, but you will generally find that no matter where you go, there will always be one or two people completely dominating the discussion in such classes. Profs are aware of them, and believe it or not (friends with an English prof, so I have all the dirt
), a lot of times they DON'T like these people. Anyway, so MOST people won't get a chance to talk much, anyway. And some profs can be very accomodating towards people who are shy - they will encourage you to participate, but I've heard of some people being given the option of keeping a sort of diary, where they'd record their thoughts and submit it to the professor instead of speaking up, if they feel uncomfortable. I wouldn't go to a prof and tell him right away that you will NOT speak, but I would ask what options they have.
Also, even if they say that "class participation is worth 20%" or something scary like that, I've gotten As in those courses saying like one or two lines per class, at most. If your essays are great, profs generally feel somewhat biased towards you and will let it slide on some other things.