According to Wikipedia (which I have no reason to believe is incorrect in this case), the Hatch Act "is a United States federal law whose main provision prohibits employees in the executive branch of the federal government, except the president, vice-president, and certain designated high-level officials, from engaging in some forms of political activity." If would therefore seem to be inapplicable to the situation you described.
As for whether any other law might apply, I suggest you provide a brief explanation of the nature of the contractor's relationship to the government and the office for which he or she is running.