If we're going to have a written text, the words have to come from somewhere. There are a few examples in the Bible of writing that comes directly from God. The original tablets of the law were "written with the finger of God" (Exodus 31:18, 32:16), as were their replacements after the golden calf incident (Exodus 34:1). There is also the "writing on the wall" in Daniel 5. But the majority of the Biblical text was written down with a human hand.
When we examine how the prophets describe their own experience, we can reach a better understanding of divine inspiration. Consider the call of Ezekiel (2:8-3:4):
"You, mortal, hear what I say to you; do not be rebellious like that rebellious house; open your mouth and eat what I give you." I looked, and a hand was stretched out to me, and a written scroll was in it. He spread it before me; it had writing on the front and on the back, and written on it were words of lamentation and mourning and woe.
He said to me, "O mortal, eat what is offered to you; eat this scroll, and go, speak to the house of Israel." So I opened my mouth, and he gave me the scroll to eat. He said to me, "Mortal, eat this scroll that I give you and fill your stomach with it." Then I ate it; and in my mouth it was as sweet as honey.
He said to me: "Mortal, go to the house of Israel and speak my very words to them."
Ezekiel is not only commanded by God to prophesy, but is supplied with the precise message, "my very words", which he receives inwardly. His words are, in a sense, coming from the scroll that he ate - the wisdom that God has given him. A similar incident occurs with John in Revelation 10.
In a similar way, Jeremiah describes how God's spirit comes upon him (1:4-10):
Now the word of the Lord came to me saying, "Before I formed you in the womb I knew you,
and before you were born I consecrated you; I appointed you a prophet to the nations." Then I said, "Ah, Lord God! Truly I do not know how to speak, for I am only a boy." But the Lord said to me, "Do not say, 'I am only a boy'; for you shall go to all to whom I send you, and you shall speak whatever I command you. Do not be afraid of them, for I am with you to deliver you, says the Lord."
Then the Lord put out his hand and touched my mouth; and the Lord said to me, "Now I have put my words in your mouth. See, today I appoint you over nations and over kingdoms, to pluck up and to pull down, to destroy and to overthrow, to build and to plant."
When John says that he was "in the Spirit on the Lord's day", and heard a voice telling him "Write in a book what you see" (Revelation 1:10-11), this is the sort of thing that is happening. He is commanded to write, but he is also inspired - he says, "in the Spirit".
From John's gospel, we even know that prophecy can come involuntarily, as God inspires someone who is unaware of what is happening. This takes place with Caiaphas (John 11:49-52),
Caiaphas, who was high priest that year, said to them, "You know nothing at all! You do not understand that it is better for you to have one man die for the people than to have the whole nation destroyed." He did not say this on his own, but being high priest that year he prophesied that Jesus was about to die for the nation, and not for the nation only, but to gather into one the dispersed children of God.
The Biblical texts do bear signs of their human composition. Even without deep forensic analysis, we see that Luke, for example, says (1:1-4) that he "decided" to investigate the gospel events in order to write "an orderly account" for Theophilus. This does not mean that Luke's gospel is not inspired. We can say that what happened on the surface - Luke's decision - can be in response to God's inspiration, for it is the Holy Spirit who teaches us everything (John 14:26). That passage in John's gospel even says that the Spirit is to "remind" the disciples of Jesus's words after he has gone! Mark 13:11 and Matthew 10:20 are relevant here too, as they promise that the Spirit will supply the disciples with the words they need in times of danger.
Therefore, there is no contradiction between the Bible being written by humans, and its being written in the way that God wanted it. The means by which this takes place is "inspiration", the unfolding of God's wisdom into the human soul.