It seems to work if I omit the -dUseCIEColor parameter. I also added an parameter to collect the output like Sami Laine suggested. This is my final code:
$input = PDF_DIR . 'input.pdf';
$output = PDF_DIR . 'output.pdf'
exec("'gs'
'-o $return'
'-sDEVICE=pdfwrite'
'-sProcessColorModel=DeviceCMYK'
'-sColorConversionStrategy=CMYK'
'-sColorConversionStrategyForImages=CMYK'
'-sOutputFile=$output'
'$input'
");
Thank you for your answers!