A: No, for at least three reasons.
First of all, Paul is stating his own personal opinion. Elsewhere (First Corinthians 7:7) Paul says that he wishes that all men were as he himself is -- that is, celibate. But that does not mean that it is wrong for men to marry. It does not even mean that it is right for a particular man to remain celibate. Pauls wish is exactly what Paul presents it as: Pauls wish, no more and no less. This observation alone clears up any charge of contradiction.
Secondly, Jesus mentions here -- as He did when discussing almsgiving a few verses earlier -- that the error of the ones doing the public praying was their motive: to be seen of men. Private prayer ought to be the mainstay of Christians prayer-practices, but public prayer can sometimes be beneficial. One good example is in Acts 27:31-36, where Paul resorted to public prayer not only to communicate with God but as a means of encouraging others to put themselves into Gods hands, or to recognize that that is where they already were. Those guided by the Holy Spirit should use wisdom, if they feel that a public prayer is appropriate, to assure that glory goes to God and not themselves.
Thirdly, a sub-question here is What did Paul mean by everywhere? Did he mean that he wanted men to pray, lifting up holy hands, in every conceivable venue? Or did he simply mean that in all assemblies where the Christians were meeting (in the area that Timothy was looking after), he wanted the men to lift up holy hands as they prayed? Most of First Timothy is about matters within the church; the application of this recommendation may likewise have been understood to be limited to prayers within the various church-assemblies.
Another sub-question is What did Jesus, and Paul, each mean by prayer? The milieu of Jesus listeners was different from the milieu of Pauls readers. When performed by the religious leaders in Judea, prayers could be vveerryyy lengthy, ceremonial, and recitational. Others consisted of short blessings, and I dont think anyone thinks that short blessings are the sort of prayer that the hypocrites mentioned in 6:5 were praying. It wasnt Jesus intention to forbid public benedictions and thanksgiving-prayers. The implicit target in 6:5 is made explicit in 23:14 -- the scribes and Pharisees for a pretense make long prayers. When a Christian publicly prays a short unpretentious prayer, the content of which is a benediction or thanksgiving, he has the example of Christ Himself as a precedent, for Jesus publicly blessed the loaves and fish with which the 5,000 were fed. Still, this sort of thing should be very rare compared to the time we spend in private prayer.
(I could add that community leaders may sometimes, in some places, find themselves in circumstances in which they may offer public prayer as part of an expression of corporate repentance or a corporate petition, like some Old Testament kings did; this is something special for them in their roles. To get into the math of that might be a tangent, though. I think this is sufficient to show that the meaning of what Jesus says in Matthew 6:5-6 does not contradict the meaning of what Paul wrote in First Timothy 2:8.)
Yours in Christ,
Waterrock
