The public defender shall petition the court to withdraw as attorney of record, and the court may grant such petition, whenever private counsel is employed either by the defendant or by any other person to represent such defendant and such private counsel is accepted by the defendant.
A.R.S. § 11-587