If you took a deduction in the past for contributions, now it is taxable when you remove it. In addition, you will pay a penalty tax. There's nothing you can do about that.
Some (all?) states allow an adjustment for contributions that could not have been deducted on your state return when you made the contribution.