The Nasdaq and other major US stock indices moved higher on Thursday, boosted by a strong rally in Tesla and Nvidia shares.