The prime ministers of Japan and Vietnam have held talks, vowing to strengthen ties between the two nations.