US President Joe Biden and Chinese leader Xi Jinping have agreed that a “nuclear war should never be fought” as they met ahead of the G20 summit in Bali.