Nadal secures world No.1 until end of year