If God willed, he could have brought them all to the guidance. (6:35)
If it had been your Lord's will, all who are on the Earth would have believed, all together. (10:99)
You do not guide whom you like, but God guides whom He wills. (28:56)
You cannot make the dead to hear, nor can you make the deaf to hear the call when they have turned to flee. Nor can you guide the blind out of their deviation. You can make none to hear save those who believe in Our Revelation so that they surrender and become Muslims. (30:52–53)
Since it is God Who guides, we implore Him in every rak'a of our daily prescribed prayers: Guide us to the Straight Path (1:6). God's Messenger says: "I have been sent to call people to belief. It is none but God only Who guides them and places belief in their hearts."
Besides the verses above and many other similar ones, other verses state that God's Messenger calls and guides people to the Straight Path: Surely you call them to the Straight Path (23:73) and:
Thus We have revealed a Spirit to you from Our Command. You did not know what was the Scripture, nor what the Faith was, but We have made it a light whereby We guide whom We will of Our servants. You are indeed guiding to the Straight Path. (42:52)
These verses are not contradictory. As we said above, God creates everyone with the potential to accept belief. However, the family, educational, and environmental conditions have a certain role in guidance or misguidance. So, in order to call people to belief, God sent Messengers throughout human history and gave some of them Books whereby people could reform themselves. Prophet Muhammad, the last Messenger, received the Qur'an from God via revelation. The Qur'an, being the last Divine Book and uncorrupted, contains the principles of guidance.
The Messenger's personal conduct and good example, which embody its teaching, also make his way of life a means to guidance. He recites the Divine Revelation, shows people the signs of God, and destroys their misconceptions, superstitions, and sins. In fact, every thing, event, and phenomenon is a sign pointing to God's Existence and Unity. Therefore, if you want to believe sincerely and without prejudice, struggle against carnal desires and the temptations of your evil-commanding self, and use your free will to seek the truth, God will guide you to one of the ways leading to Him. He declares in the Qur'an:
Be aware of God and seek the means (of approach to and knowledge of) Him, and strive in His way in order that you may succeed and be prosperous [in both worlds]. (5:35)
As for those who strive in Us [in Our way, for Our sake, and to reach Us], We guide them to Our paths; God is with the good. (29:69)
In order to find or to deserve guidance, you must strive for it sincerely and search for the ways leading to it. Those whom God has blessed with guidance should set good examples for others, and then call others to it through all lawful (Islamic) means. In many verses, God commands His Messenger to do just that:
Warn your tribe of near kindred [of their end and the consequences of their deeds and of the punishment of Hell). (26:214)
Remind and give advice, for you are one to remind. (88:21)
Proclaim openly and insistently what you are commanded. (15:94)
Call to the path of your Lord with wisdom and fair exhortation, and reason with them in the most courteous manner. (16:125)
Surely in the Messenger of God you have a good example for him who hopes for God and the Last Day, and remembers God oft. (33:21)
The Messenger communicated God's revelations to people and called them to belief in the best and most effective way. He also bore all difficulties and persecutions, and rejected the most alluring bribes to stop calling people to belief in God. He continued his mission without expecting any worldly reward. Since he sought only God's good pleasure and to cause people to be prosperous in both worlds, when he conquered Makka (an event marking his triumph to make God's Word prevail among his people) he forgave those who had persecuted both him and his followers for 21 years, saying: "No reproach this day shall be on you. God will forgive you. He is the Most Merciful of the Merciful. Go! You are free."
He once told 'Ali: If someone finds guidance at your hand, this is better for you than having red camels.  According to the rule that "the one who causes is like the doer," the one who leads another to guidance receives the same reward as the new believer, without any decrease in his or her own reward. Similarly, the Messenger says:
Whoever establishes a good path receives the same reward as those who follow that path thereafter until the Last Day, without any decrease in their reward. Whoever establishes an evil path is burdened with the same sins as those who follow it thereafter until the Last Day, without any decrease in their burden. 
Those who lead others to guidance should not remind them of this by saying such things as: "If I hadn't been a means to your guidance, you never would have been guided." This is a grave sin and shows ingratitude to God, for only God guides and causes one to lead another to guidance.
Similarly, those use by God to guide someone to guidance, should never attribute their deed to themselves. Rather, they should say something like: "Praise God, for He has made me, a poor and needy person, a means for so meritorious a deed as leading someone to guidance. God is so powerful, so merciful to His servants, and so munificent that He creates clusters of grapes on wood. The wood has no right to ascribe to itself the grapes growing on it. I am no better than that wood."
As for those who have found guidance, they should think: "Seeing my need and helplessness, God, my Master, used one of His servants to lead me toward guidance. All praise be to Him." Nevertheless, the one led to guidance should be thankful to the person so used by God. After all, since God is the Creator of us and whatever we do, He also creates the means that enable guidance and misguidance. But this does not negate or diminish our free will when it comes to guidance or misguidance.
 Muslim, Zakat, 69; Ibn Maja, Muqaddima, 203.