Rubens Barrichello has confirmed that he is leaving IndyCar and will contest the 2013 Brazilian StockCar Championship.