In an action to modify, vacate, or enforce that part of an order providing for custody of a child or visitation with a child, the court may, upon request of a party, award attorney fees and costs of the action. In awarding attorney fees and costs under this section, the court shall consider the relative financial resources of the parties and whether the parties have acted in good faith.