In my opinion, although Jesus could certainly have healed the leper merely through the spoken word (as he did in Luke 17:12-19, for example), He touched him as a visible demonstration of God's love for even the most outcast and "unclean" of individuals.
Such an action did not violate the Law because the provisions concerning leprosy and the isolation of lepers (as far as I am aware) were meant for the protection of non-lepers. By choosing to forgo that precaution, Jesus (in addition to healing the leper) was providing a concrete example of "doing more than others do" (as He instructed His followers in passages such as Matthew 5:46-48).