Existing closed-form solutions of contaminant transport problems are limited by the mathematically convenient assumption of uniform flow. These solutions cannot be used to investigate contaminant transport in coastal aquifers where seawater intrusion induces a variable velocity field. An adaptation of the Fourier-Galerkin method is introduced to obtain semi-analytical solutions for contaminant transport in a confined coastal aquifer in which the saltwater wedge is in equilibrium with a freshwater discharge flow. Two scenarios dealing with contaminant leakage from the aquifer top surface and contaminant migration from a source at the landward boundary are considered. Robust implementation of the Fourier-Galerkin method is developed to efficiently solve the coupled flow, salt and contaminant transport equations. Various illustrative examples are generated and the semi-analytical solutions are compared against an in-house numerical code. The Fourier series are used to evaluate relevant metrics characterizing contaminant transport such as the discharge flux to the sea, amount of contaminant persisting in the groundwater and solute flux from the source. These metrics represent quantitative data for numerical code validation and are relevant to understand the effect of seawater intrusion on contaminant transport. It is observed that, for the surface contamination scenario, seawater intrusion limits the spread of the contaminant but intensifies the contaminant discharge to the sea. For the landward contamination scenario, moderate seawater intrusion affects only the spatial distribution of the contaminant plume while extreme seawater intrusion can increase the contaminant discharge to the sea. The developed semi-analytical solution presents an efficient tool for the verification of numerical models. It provides a clear interpretation of the contaminant transport processes in coastal aquifers subject to seawater intrusion. For practical usage in further studies, the full open source semi-analytical codes are made available at the website https://lhyges.unistra.fr/FAHS-Marwan.