We propose a novel design of a dual-function radar communication (DFRC) system aided by an Intelligent Reflecting Surface (IRS). We consider a scenario with one target and multiple communication receivers, where there is no line-of-sight between the radar and the target. The radar precoding matrix and the IRS weights are optimally designed to maximize the weighted sum of the signal-to-noise ratio (SNR) at the radar receiver and the SNR at the communication receivers subject to power constraints and constant modulus constraints on the IRS weights. The problem is decoupled into two sub-problems, namely, waveform design and IRS weight design, and is solved via alternating optimization. The former subproblem is solved via linear programming, and the latter via manifold optimization with a quartic polynomial objective. The key contribution of this paper lies in solving the IRS weight design sub-problem that is based on the optimization of a quartic objective function in the IRS weights, and is subject to unit modulus-constraint on the IRS weights. Simulation results are provided to show the convergence behavior of the proposed algorithm under different system configurations, and the effectiveness of using IRS to improve radar and communication performance.