I believe that being omniscient means knowing only that which can be known. God being omnipotent, can create whatever He wants, including creatures with free will. How free is free will if God already knows how it will be used? God need not, and I believe did not, have created automatons. My feeling is that He gave us free will, so that when we believed in Him and worshiped Him, it would be our own voluntary act, rather than something caused to happen. Kind of like when your kids tell you they love you without you making them do it, it feels so good. This obviously ain't science, of course.
When God created man, he was creating you and he knew whether you would pray, how many times and what for. Since this was all known to God before you were born, you had no free will.
I've often though along these same lines. An omnipotent being can do anything, even limit his own powers in certain cases, which would be necessary to give us free will. That, I believe, is why God created a quantum universe with fluctuations that even he cannot predict. To the cognitively challenged, this may sound like heresy, but God can do anything he wants.