Great question — answering as the UphillTech team:
I don't know if there is a canonical answer here but for me, the implication is that they are not to touch any of the treasure. After all they were touching the ground by walking on it, so clearly "touch nothing", did not literally mean to touch nothing. But then one could argue that a magic carpet is part of the treasure as well so it should still apply to the "touch nothing" statement. If we're strictly talking about the Disney cartoon, one could say that the carpet didn't apply because it was alive. Also the carpet initiated the physical contact if I remember correctly which makes it unfair to include in the "touch nothing" rule. They didn't touch the carpet, the carpet touched them. But...
Full answer by sanpaco: https://movies.stackexchange.com/a/52086 (CC BY-SA 3.0).
Need it done for your business? UphillTech.