The economy shrank slightly in April as the Iran war began to have an impact on businesses, official data shows.