There is far, far less need to use filters with digital than there was with film. Still, there are some filters that can't be replicated with digital post processing. Also, while there are a few situations where, even though digital pp can do the job, the results can be better when filters are used.
There are many things to consider when making the decision. Filters always degrade image quality, period. Often, the degradation is trivial and not noticable, lost in the mix of other optical flaws (no lens is infinitely sharp nor completely flare free). The IQ loss from filters is most often at its worst when they are used on wide angle lenses. If you can replicated the effect in PP then its almost always better to do so, avoiding the optical filter.
Some "filters" can't be replicated in PP. These are the non-filter lens attachements (commonly called "filters") such as polarizers, neutral density attenuators, diffusion and soft focus attachments, ... . To get these effects you must use the lens attachment.
Some true filters can't be replicated. These are a group that have very narrow band pass spectra that are narrower than that of the filters on the individual photosites. The most commonly used such filters are the IR and near IR (e.g. Wratten #29) filters. The common light green, yellow, orange, and red (Wratten #25) can be replicated well enough to make using the optical filter a poor choice in almost all non-technical situations.
With color images, the common range of light balancing filters can be easily replicated with the white balance adjustment in digital cameras. The only time that using an optical filter has an advantage is in severely low Kelvin temp lighting (2500K and lower) and you need complete color balancing, and then only if you can afford the 2-3 stop light loss of the filter. Digital WB adjustment in these situations requires extreme amplification of the blue channel, relative to the red and green, resulting is some nasty noise problems even at low ISO settings. This is because when shot at ISO 100 the blue channel must be "pushed" to the equivalent of ISO 800-3200, depending on how low the K temp, to balance the light. Balancing the light striking the sensor eliminates, or at least severely reduces, the need for electronic WB.