Japan's prime minister has said that his country offers its "total support" to Theresa May's EU Withdrawal Agreement.