Italian Prime Minister Matteo Renzi has announced his resignation after exit polls showed he had lost the constitutional reform referendum.