You will need to set the TRIS for the port. That will tell what pins are input or out puts.
Try adding this near the top of your code.
Code:
TRISB = %00001111
That will make PORTB 0 to 3 an input and 4 to 7 an output.