Since you are able to get the counter running first time, I am assuming that the pin assignments are correct. But it's worth verifying one more time for the Cyclone II device. If that is correct, then try to verify the board's connectivity. Try to run a simple code, which simply uses the clock that you are using for the counter and blinks the LED. If the LEDs get correct signals, then board must be OK.
Also try to simulate the code in Quartus II simulator to see how it works for the Cyclone II device.
Is it a design requirement to realize this counter using D flip-flops?