If you sign a player after putting someone on IR, your team homepage will say you have 54 players under contract (if you have a full 53 man roster beforehand). That's legal, and if you want to check to be sure, go to your depth chart, it will say 53.
I currently have 1 player on IR, and regardless of whether I'm on my phone or PC, my team homepage shows 54 under contract while depth chart shows 53. Both are technically correct as the homepage tells you all contracts, the depth chart only shows eligible players who can actually play.