If a child in a juvenile court hearing who is the subject of the petition that does not allege a delinquent act or incorrigibility is represented by counsel in a contested matter, the county attorney, when requested by the juvenile court judge, shall appear and participate in the hearing to assist in ascertaining and presenting evidence.