No, it isn't a contradiction—not at all. When the Bible says God can't look at evil, it means that He can't tolerate or endure it, and it is an offense to Him.
The Bible puts it this way: "Your eyes are too pure to look on evil; you cannot tolerate wrong" (Habakkuk 1:13). Just as you might put your hands over your eyes if you saw a terrible car accident, so God covers His eyes (so to speak) when He sees the evils of our world.
But that doesn't mean God doesn't know what is going on, or that He doesn't know about evil when it happens. God knows exactly what is going on! When King Asa in the Old Testament turned away from God, one of the prophets reminded him that his deeds could not be hidden from God: "For the eyes of the Lord range throughout the earth. ... You have done a foolish thing, and from now on you will be at war" (2 Chronicles 16:9).
Both of these truths remind us of an even greater truth: God is far greater and more perfect than anything we can begin to imagine. He is perfect in His knowledge—and He also is perfect in His purity. But another truth is equally important: God is also perfect in His love. He sees us just as we are, and yet He still loves us. Is His love real to you? It can be, as you give your life to Christ and allow His love to fill you.