If a defendant is convicted of, receives a deferred judgment for, or pleads guilty to a public offense referred to in
section 664A.2, subsection 1, or is held in contempt for a violation of a no-contact order issued under
section 664A.3 or for a violation of a protective order issued pursuant to
chapter 232,
235F,
236,
236A,
598, or
915, the court shall either terminate or modify the temporary no-contact order issued by the magistrate. The court may enter
a no-contact order or continue the no-contact order already in effect for a period of five years from the date the judgment
is entered or the deferred judgment is granted, regardless of whether the defendant is placed on probation.