UK retailer Marks and Spencer is to close four stores in the Republic of Ireland, resulting in 180 job losses.