If you were receiving Carers Allowance, or your wife was receiving Disabled Living Allowance or Attendance Allowance, your pension rights for that period should have been protected - I would suggest you contact HMRC as soon as possible to make sure you have been credited with contributions, or if necessary to check how you can make up any defecit with voluntary contributions. There is a time limit so get in touch as soon as possible.
http://www.hmrc.gov.uk/nic/aboutus.htm