US stocks recovered from a wobble fuelled by weaker-than-expected data on US consumer confidence, as the heavyweight tech companies staged a rally.