Electric-car maker reports record quarterly revenue but acknowledges ‘uncertain macroeconomic environment’