Yeru,
You are right; there is a contradiction, but I'm inclined to believe that it's not about whether the young David--or someone else--killed the giant Goliath; it's about who a warrior named "Elhanan" killed.
1 Samuel 17 tells us that a young David is sent against the nine-foot Goliath by King Saul; this is the story we're all familiar with.
1 Chronicles 20:5 tells about battle that occurred after David had become king, and therefore after the young David slew Goliath in 1 Samuel. In this later battle we're told that a warrior named Elhanan killed Lahmi the brother of Goliath. So far, so good. The problem comes when one reads that "Elhanan…killed Goliath…" in 2 Samuel 21:1-19. Thus, the contradiction need not be over the name of the person who killed Goliath, as Yeru suggested, but over who Elhanan killed.
We can either believe that the Bible is wrong because it tells us the young David killed Goliath in 1 Samuel, while in 2 Samuel we're told the Elhanan killed Goliath, or else we can believe simply that the transcriber of the verse in 2 Samuel inadvertently left out the words "Lahmi the brother of ." I think the latter is far more likely. But, either way, there's clearly a contradiction, as Yeru said.
Joseph F. Alward
"Skeptical Views of Christianity and the Bible"
http://members.aol.com/jalw/joseph_alward.html