This is not necessarily a contradiction between sources, but rather a theological tension inherent in the Hebrew Bible itself. The question of agency with respect to a wrongdoing or sin is often presented in a dual manner. The present case is merely one example of that.
Here, the plague narrative presents both Pharaoh as choosing not to let the Hebrews go and Yahweh as pulling his strings, so to speak, and hardening his heart.
On the other hand, the Hebrew Bible as a whole is often ambiguous about whether sin is produced by human agency or divine intervention. It is often presented as a mixture of the two. This is clearly the implication drawn out in the Plague narrative where both Pharaoh is presented as hardening his own heart (8:11, 8:28, 9:35) and Yahweh is presented as hardening his heart (4:21, 9:12, 10:20, 10:27, 11:10).
Although Yahweh may be the cause of Pharaoh’s own wrongdoing, it would be inaccurate to assign guilt to Yahweh, that is looking at this through the biblical writers’ theological prism. In the Plague narratives, Yahweh’s hardening of Pharaoh’s heart is best understood as Yahweh exacerbating a sin that is already inherently from Pharaoh himself. Pharaoh’s guilt (which is also merely the perspective adopted by the narrator; and thus I’m not speaking in ontological terms) is vehicled through Yahweh’s action of hardening his heart. By doing so Yahweh looks to be the dispenser of justice.
Thus, and again from the perspective of the biblical authors, Yahweh always remains sinless, even when he’s killing off the masses, destroying Judah, tempting Job, sending bears to ravish children, or commanding father’s to sacrifice sons. This is difficult to assess for modern readers because modernity has been influenced by later Judaic and Christian ideas of a separate “evil” agent who has absorbed these functions which formerly belonged to Yahweh. William Propp puts it this way:
In most of the Hebrew Bible, God plays the role later Judaism reserves for Satan. Ha satan ‘the Adversary’ first appears in early postexilic writings as an officer in Yahweh’s angelic court entrusted with presenting human behavior in the worst light (Zech 3:1-2; Job 1-2). But when Judaism encountered Zoroastrianism, Persian dualism evidently attracted thinkers troubled by Yahweh’s role in creating evil and misfortune. Beginning in the Persian period, various spirits—Belial, Mastemah, Asmodai, Sammael, the Evil Impulse, Satan—assumed the task of seducing humanity toward evil and launching attacks against individuals. For example, although it is Yahweh who tempts David into sinfully ordering a census (2 Sam 24:1), a later retelling (1 Chr 21:1) makes the instigator Satan. Similarly, while it is Yahweh who attacks Moses in Ex 4:24, in Jubilees 40:2, the adversary is Mastemah. Even the command that Abraham sacrifice his son (Gen 22:2) is, according to Jubilees 17:15-16, Mastemah’s doing (Exodus 1-18, 354).
We will take another look at the “evil” that Yahweh does and how this is re-presented in the New Testament in contradiction #94 (similarly see #6). Again, it would be absurd, and disingenuous to the biblical writers themselves, to think that religious ideas and beliefs did not change over the 1,000 years within which the Bible’s variant texts were written.
Finally, this idea of double agency, human and divine, is not unique to the Hebrew Bible. In fact it’s a characteristic found in most ancient literature. The classic example from Homer is the scene in the Iliad where Achilles is enraged against Agamemnon. His fury, heart, is checked by the goddess Athena, but it is also checked by the warrior himself.