As part of the court order granting permission to marry under Section 302 or 303, the court shall require the parties to the prospective marriage of a minor to participate in premarital counseling concerning social, economic, and personal responsibilities incident to marriage, if the court considers the counseling to be necessary. The parties shall not be required, without their consent, to confer with counselors provided by religious organizations of any denomination. In determining whether to order the parties to participate in the premarital counseling, the court shall consider, among other factors, the ability of the parties to pay for the counseling. The court may impose a reasonable fee to cover the cost of any premarital counseling provided by the county or the court. The fees shall be used exclusively to cover the cost of the counseling services authorized by this section.