When God calls us into the lordship and rule of Jesus, He calls us out of the world and plucks us out of the darkness that is in this world. However, that in no way means that He removes us from the fellowship of unbelievers because God still keeps us in this life so that we may be a light and blessing to everyone around us, non-believers included.
Many times in scripture, we are given warning and instruction to steer clear of the influence and yoke of people who do not believe in God and His Word. While there are many, here are just a few scriptures:
1 Corinthians 15:33. "Do not be deceived: 'Bad company ruins good morals.'"
Proverbs 12:26. "The righteous should choose his friends carefully, for the way of the wicked leads them astray."
2 Corinthians 6:14. "Do not be unequally yoked with unbelievers. For what partnership has righteousness with lawlessness? Or what fellowship has light with darkness?"
So does that mean that we are to completely cut ties with non-believing friends? That shouldn't be entirely the case. In 1 Corinthians 9:20-22, Paul teaches us to be "Jews to the Jews" and "Greeks to the Greeks" so that we may win them over to Christ. Matthew 5:16 also tells us, "In the same way, let your light shine before others, so that they may see your good works and give glory to your Father who is in heaven."
So does the Bible contradict itself in this area? It's not so much that the Bible contradicts itself, but that it provides complete and well balanced counsel in the area of building and maintaining friendships with the unbelieving. I believe that different situations will call for different actions.
If a non-believer friend asks you to take part in ungodly practices and pressures you even to do so, then I believe that may be a sign to walk away and even sometimes sever a friendship. But in situations where you can give more blessings than gain more risks, then we can remain in friendship with unbelievers as long as we are not unequally yoked.
At the end of the day, what matters most is not who on this earth we build communion with, but whether our communion and relationship with Jesus Christ grows and thrives. The greater and deeper our walk with God becomes, the more pressure we can take from the outside without being affected on the inside.
Our unbelieving friends, family members and colleagues need the light, power and life that we can bring if we are truly connected to the vine that is Christ and we can be that conduit of blessing to them, but only as long as we remain under the lordship of Jesus and not under the yoke of the world.