Let's not get wrapped around the "casting a spell" part of the scenario... the cleric cast it when he was out of the threatened area.
Hypersmurf made an excellent point with the Cat and Ogre Show, but I could just as easily answer "yes, it does trigger an AoO". Just because two things share a space does not mean that reaching into that space should be any less dangerous. (Would touching the cat with an attack be any less dangerous than trying to grab something that's not a razor-tipped furball?)
To me, the determinant of whether an action draws an AoO or not is how much attention it requires (italics mine).
SRD: Some actions, when performed in a threatened square, provoke attacks of opportunity as you divert your attention from the battle. Actions in Combat notes many of the actions that provoke attacks of opportunity.
Touching a fallen comrade when your enemy is standing over his body is something that I feel "diverts attention". It's not the spell that draws it.
There may never be full agreement on this, and that's fine.

D&D is and always has been a fairly subjective rule set. (Hence my motto: "D&D is only as balanced as the DM.") Even if my DM disagrees with my assessment, I'll go with his interpretation as long as it's fairly applied.
Telas