The following is a full solution to the original puzzle, without cheating from knowing the values of a and b.
The primes under 20 are 2, 3, 5, 7, 11, 13, 17, and 19.
If we assume all eight primes are used:
Observe that 2 is even and the other seven are odd. Regardless of the ninth number in the grid, you will have one line full of odd primes (which sums to an odd number), and another line containing the number 2 and two odd primes (which sums to an even number). Since an odd number cannot be equal to an even number, we cannot use all eight primes.
Let's try using the seven odd primes. My instinct tells me that the seven primes are part of the nine consecutive odd numbers: 3, 5, 7, 9, 11, 13, 15, 17, 19. They can easily form a magic square, in the same way 1 through 9 are laid out.
One possible magic square is
17 3 13
7 11 15
9 19 5