From W. Lassell (1852) in Astronomische Nachrichten vol. 34: "Beobachtungen der Uranus-Satelliten" (Observations of the satellites of Uranus):
In these tables I have for facility of reference employed a nomenclature of the satellites of Uranus proposed at my request by Sir John Herschel and selected by him from fairy mythology. The most distant of the two bright satellites discovered in 1787 by Sir W. Herschel is denominated Oberon, the other Titania, and pursuing still the order of distance, the interior ones now discovered are named Umbriel and Ariel.
This shows that it was John Herschel (son of William Herschel, the discoverer of Uranus, Titania and Oberon) who originally decided the nomenclature scheme at the request of William Lassell, the discoverer of Ariel and Umbriel. Interestingly it appears that the scheme was originally intended to be fairy mythology, which is not how the names are currently assigned. Nevertheless there is some debate around who exactly was responsible because the actual correspondence has been lost.
This pattern was broken by Gerard Kuiper, the discoverer of Miranda, see Kuiper (1949) in Publications of the Astronomical Society of the Pacific, vol 61, "The Fifth Satellite of Uranus". Unlike the previous satellites, Miranda is named after a human character (the daughter of Prospero) in Shakespeare's The Tempest:
Miranda was chosen as the name for the fifth satellite.
Uranus' own children, the Titans, are not suitable for mythological reasons; they have been assigned to the son of Uranus,
Saturn (Kronos), who gained supreme power after wounding
his father. Sir John Herschel named the four bright satellites
Ariel, Umbriel, Titania, and Oberon.
Oberon and Titania are
the king and queen of the fairies in Shakespeare's Midsummer
Night's Dream; Ariel and Umbriel occur in Pope's Rape of the
Lock, while Ariel is also found in Shakespeare's Tempest. In
the Tempest Ariel is "an airy, tricksy spirit, changing shape at
will to serve Prospero, his master," while Miranda is "a little
cherub that did preserve me" (Prospero).
The convention subsequently seems to have been formalised with the discovery of the inner satellites by the scientists working on Voyager 2. The IAU set up a nomenclature committee in the wake of the naming of the Mare Moscoviense (which had the somewhat dubious justification of declaring that Moscow is a state of mind). The IAU nomenclature committee decided that the common factor behind the existing nomenclature was the source works (Shakespeare's plays and Alexander Pope's The Rape of the Lock) and named the satellites according to this pattern. Some details of this can be found in this podcast from the Folger Shakespeare Library that includes Tobias Owen, who was involved in the naming process.