Rafael Nadal lifted his first hardcourt title since 2010 after beating Juan Martin Del Potro at Indian Wells.