Short Answer: There is no contradiction here. They were both regarded as High Priest at the time of Jesus' crucifixion.
(The following is adapted largely from D. A. Carson's commentary on John.)
Annas was the official High Priest beginning in AD 6. Mosaic Law specified that the appointment of a High Priest was for life, and so he was still High Priest by Jewish standards during the time of Jesus' crucifixion.
In AD 15 Valerius Gratus (Pilate's predecessor) deposed Annas and his nephew Caiaphas was appointed. The Jews resented this arbitrary deposition -- especially by a Roman, and Annas remained High Priest in their sight. So by the time of Jesus' trial, Annas was technically (by Jewish standards) High Priest, as was his nephew Caiaphas (by both Jewish and Roman standards.)
Five of Annas' sons and his son-in-law Caiaphas served as High Priest at one time or another.1 Since Annas was the patriarch of a High-Priestly family (of which Caiaphas was a part), it made sense to bring Jesus to him first.
Note the following other passages from Scripture which lend further support to this answer:
Now in the fifteenth year of the reign of Tiberius Caesar, when Pontius Pilate was governor of Judea, and Herod was tetrarch of Galilee, and his brother Philip was tetrarch of the region of Ituraea and Trachonitis, and Lysanias was tetrarch of Abilene, in the high priesthood of Annas and Caiaphas, the word of God came to John, the son of Zacharias, in the wilderness. -Luke 3:1-2
On the next day, their rulers and elders and scribes were gathered together in Jerusalem; and Annas the high priest was there, and Caiaphas and John and Alexander, and all who were of high-priestly descent. -Acts 4:5-6
1: Josephus, Antiquities xx. 198