US President Joe Biden and Japan's prime minister have vowed to strengthen defence co-operation in the face of a potential threat from China.