My Romanian husband said you do not need the ziua, you can just say ieri. He also said this sentence would never be used and makes no sense in Romanian. shrug
Maybe you will use it very rarely, but sorry to contradict your husband, the sentence is ok and makes sense (like in English).
It is not strictly necessary but here is used to highlight the fact that yesterday is used as noun (ziua de ieri) and not as time adverbe (ieri am fost)