Costs and a reasonable attorney's fee shall be assessed against the contestant or the appellant if the contest or the appeal is maliciously or frivolously prosecuted.