Where the defendant does not have an attorney, the court shall appoint him one for purposes of the hearing. Payment of appointed counsel for indigent defendants shall be at the same rates and with the same limitations as would apply if the hearing were a criminal prosecution.