A suicide bomber has struck the north western Pakistani city of Peshawar outside a crowded courthouse.